home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-07 | 2.1 KB | 83 lines | [TEXT/MPS ] |
- //---------------------------------------------------------------------
- //
- // Copyright © 1992 David Peterson.
- // All rights reserved.
- //
- // Permission to use, copy, modify, and distribute this software for
- // any purpose and without fee is hereby granted, provided that the
- // above copyright notice appear in all copies and that both that
- // copyright notice and this permission notice appear in supporting
- // documentation.
- //
- //---------------------------------------------------------------------
-
- #ifndef __MYUTILS__
- #include <myUtils.h>
- #endif
-
- #ifndef __DAEMONAPP__
- #include <DaemonApp.h>
- #endif
- #ifndef __FILES__
- #include <Files.h>
- #endif
- #ifndef __MACTCPCOMMONTYPES__
- #include <MacTCPCommonTypes.h>
- #endif
-
- #define kFileNames 128
- #define kPrepFile 1
- #define kLogFile 2
-
- #define kLaunchFailure 128
-
- #define SwitchResFile(newfile) CurResFile(); UseResFile(newfile);
-
- class TCPListener;
- class UDPListener;
-
- class InetD : public DaemonApp {
- typedef DaemonApp Inherited;
- public:
- FSSpec fPrepFile;
- short fLogFile;
-
- TCPListener* fTCP;
- UDPListener* fUDP;
-
- short fDriverRef;
-
- InetD();
- virtual ~InetD();
-
- void LogIt(Boolean postit, char* form, ...);
-
- short GetDriver() { return fDriverRef; }
- void NewTCPListener();
- void NewUDPListener();
-
- Boolean IsRunning(Str63 name, PSNPtr psn);
- void Launch(StreamPtr stream, FSSpecPtr process, AEEventID type, PSNPtr psn);
-
- virtual void InstallAEHandlers();
- virtual void Initialize();
-
- virtual void DoNull();
- };
-
- extern "C" {
- Boolean CheckSystem();
-
- #pragma parameter TurnOnInterrupts(__D0)
- void TurnOnInterrupts(short old) = { 0x46C0 }; // move d0,sr
-
- short TurnOffInterrupts() = { 0x40C0, // move sr,d0
- 0x007C, 0x0700 }; // ori.w #$0700,sr
-
- pascal OSErr AEDeathHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- pascal OSErr AETCPNotificationHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- pascal OSErr AEUDPNotificationHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- pascal OSErr AEResetHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- };
-
-